<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
table{word-break:break-all;}
td{overflow:hidden;word-break:break-all;}
-->	
</style>
<title>web gui for Dargens</title>
<script type='text/javascript' src='/javascripts/prototype.js'></script>
<script type='text/javascript' src='/javascripts/casper/common.js'></script>
<script type="text/javascript" src="/javascripts/scriptaculous.js"></script>
<script type="text/javascript" src="/javascripts/effects.js"></script>
<script type="text/javascript" src="/javascripts/getRealPopup.js"></script>
<%= javascript_include_tag :defaults %>
<script language="JavaScript" type="text/JavaScript">
function showMsg(s)
{
	switch(s)
	{
	case 'dok':
		if(document.getElementById('dres').style.display=='none')changediv();
		tt_Hide();//hidden tooltips
		alert('Added to downloading queue!');
		break;
	case 'dno':
		//alert('Can't downloading this file!');
		break;
	}
}

var queryed=0;
var scriptSearch=new JavaScriptExecuter();
function dosearch(){
	var a=document.getElementById('q').value;
	var b=document.getElementById('content').checked?'1':'0';
	var c=document.getElementById('c1').checked?'commit_string':'commit_hash';

	if(a.length==0)return false;
	scriptSearch.run("http://127.0.0.1:54321/webgui/search?query="+a+"&content="+b+"&catelog="+c);
	queryed=1;
	if(document.getElementById('dres').style.display=='block')changediv();
	return false;
}
var scriptDown=new JavaScriptExecuter();
function download(a)
{
	scriptDown.run("http://127.0.0.1:54321/webgui/get?query="+a);
	return false;
}

var scriptRefresh=new JavaScriptExecuter("http://127.0.0.1:54321/webgui/refresh");
var noresult=1;
function refresh_res(){
	if(queryed!=1){return;}
	if(noresult!=1){noresult--;return;}
	scriptRefresh.run();
}
/*
function myescape(src)
{
	src=escape(src);
	src=src.replace(/\+/g,"%2B");
	return src;
}*/
function dodownload(filename)
{
	//filename=myescape(filename.substring(filename.lastIndexOf('/')+1));
	window.open("http://127.0.0.1:54321/webgui/open?query="+filename);
	return false;
}
function dochat(sid)
{
	scriptDown.run("http://127.0.0.1:54321/webgui/chat?query="+sid);
	return false;
}
var asTips=[];
var qRes=[];
function dispres(res,dres)
{
	qRes=res;
	var RESSIZE=res.length;
	var sc="";
	if(RESSIZE!=0)
	{
		noresult=2;
		sc='<TABLE width="530" border="0" cellspacing="2" cellpadding="2" class="table2" bgcolor="#ECF9FF">';
		for( var i=0;i<RESSIZE;++i)
		{
			var obj=res[i];
			var tips="<table>";
			tips+="<tr><td>Name</td><td><div style=\"overflow:hidden\">"+obj[1]+"</div></td></tr>";
			tips+="<tr><td>Sources</td><td><div style=\"overflow:hidden\">"+obj[2]+"</div></td></tr>";
			tips+="<tr><td>Max % completed</td><td><div style=\"overflow:hidden\">"+obj[3]+"</div></td></tr>";
			tips+="<tr><td>File Size</td><td><div style=\"overflow:hidden\">"+obj[4]+"</div></td></tr>";
			tips+="<tr><td>Last Seen on</td><td><div style=\"overflow:hidden\">"+obj[5]+"</div></td></tr>";
			tips+="<tr><td>File Infos</td><td><div style=\"overflow:hidden\">"+obj[6]+"</div></td></tr>";
			tips+="<tr><td>File Hash</td><td><div style=\"overflow:hidden\">"+obj[7]+"</div></td></tr>";
			tips+="</table>";
			asTips[i]=tips;
			sc+="<TR><TD width='420'><div style='overflow:hidden; width:420px' onmouseover='Tip(asTips["+i+"],TITLE,\"File info\", SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, 1, OFFSETX, -20)'>";
			switch(obj[0])
			{
			case 0:
				sc+="<A href='"+obj[7]+"' style='color:blue' onclick='return dodownload(\""+obj[7]+"\")'>"+obj[1]+"</A>";
				break;
			case 1:
				//sc+="<span style='color:yellow'>"+obj[1]+"</span>";
				sc+="<span>"+obj[1]+"</span>";
				break;
			case 2:
				sc+="<span>"+obj[1]+"</span>";
				break;
			//case 3:
			default:
				sc+="<A href='"+obj[7]+"' onclick='return download(\""+obj[7]+"\")'>"+obj[1]+"</A>";
				break;
			}
			sc+="</div></TD><TD width='40px'>"+obj[4]+"</TD><TD width='54px'><a href='javascript:initSubmit(\""+obj[7]+"\");'>submit</a></TD></TR>";
		}
		sc+="</TABLE>";
	}
    document.getElementById("qres").innerHTML=sc;
	RESSIZE=dres.length;
	sc="";
	var sStatus=['downloading','ready','interrupted'];
	if(RESSIZE!=0)
	{
		sc='<TABLE width="530" border="0" cellspacing="2" cellpadding="2" class="table2" bgcolor="#ECF9FF">';
		for( var i=0;i<RESSIZE;++i)
		{
			var obj=dres[i];
			var bOk=(obj[1]==1);
			sc+="<TR><TD width='390'><div style='overflow:hidden'> ";
			if(bOk)	sc+='<a href="'+obj[2]+"\" style='color:blue' onclick='return dodownload(\""+obj[2]+"\")'>";
			sc+=obj[0];
			if(bOk)	sc+='</a>';
			var sInt=(obj[1]==2)?'paused':'';
			sc+="</div></TD><TD width='34'>"+(bOk?'100':obj[3])+'%</TD><TD width="130">'+sStatus[obj[1]]+(obj[4].length==0?'':'&nbsp;&nbsp;&nbsp;&nbsp;<a href="chat/'+obj[4]+"\" onclick='return dochat(\""+obj[4]+"\")'>chat</a>")+"</TD></TR>";
		}
		sc+="</TABLE>";
	}
    document.getElementById("dres").innerHTML=sc;
}
var scriptadddir=new JavaScriptExecuter("http://127.0.0.1:54321/webgui/adddir");
function adddir()
{
	scriptadddir.run();
	return false;
}
var peobj=null;
function wload()
{
	if(<%=(params[:server]==""?"false":"true")%>)
	{
		document.getElementById("file_download").src="/jnlp/make?server=<%=params[:server]%>";
	}
	if(document.getElementById('q').value.length>0) dosearch();
	peobj=new PeriodicalExecuter(function() {refresh_res();},3);
	wload2();
}
</script>
<script>var queryed=0;</script>
<script language=javascript>
var CanSearch=false;
var csstatus='';
function setStatus(s)
{
	isRefresh=0;
	var csss='';
	var be=true;
	switch(s)
	{
	case 'ok':
		if(csstatus==s) return;
		csstatus=s;
		csss='greenb';
		be=false;
		break;
	case 'load':
		if(csstatus==s) return;
		csstatus=s;
		csss='yellowb';
		break;
	default://not running
		if(csstatus=='') return;
		csstatus='';
		csss='redb';
		break;
	}
	CanSearch=!be;
	document.getElementById('searchstatus').className=csss;
}
var peobj=null;
var pscrobj=null;
var isRefresh=0;
function wload2()
{
	pscrobj=new JavaScriptExecuter("http://127.0.0.1:54321/webgui/status");
	peobj=new PeriodicalExecuter(function() {isRefresh++;if(isRefresh==2){isRefresh=0;setStatus('');};pscrobj.run();},3);
}
</script>
<link href="/stylesheets/style.css" rel="stylesheet" type="text/css" />
</head>

<body onload='wload()'  bgcolor="#FEFEFE" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<script language=javascript>
PopupVariables = [0.5, 0.6, '#000000', true, 200, 200];
var isSubmitting=false;
function initSubmit(sVal)
{
	var bv=qRes;
	for(var i=0; i<bv.length;++i)
		if(bv[i][7]==sVal)
		{
			document.getElementById('subfilename1').value=bv[i][1];
			document.getElementById('subfilename').innerHTML= bv[i][1];
			document.getElementById('subfilehash1').value=bv[i][7];
			document.getElementById('subfilesizelong').value=bv[i][8]+'';
			document.getElementById('subfilesize1').value=bv[i][4];
			document.getElementById('subfilesize').innerHTML= bv[i][4];
			document.getElementById('subfiledesc').value=bv[i][6];
			showPop('myDiv', 400, 400);
			return;
		}
}
function closesubmit()
{
	//if(!isSubmitting)
		hidePop( 'myDiv' );
}
function submitOK()
{
	isSubmitting=false;
	hidePop( 'myDiv' );
}
function submithotfile()
{
	isSubmitting=true;
	document.getElementById('hotfileform').submit();
	return false;
}
</script>
<div id="myDiv" style="display:none;width: 500px;height: 150px;position: absolute;background-color:#CEDEFF;border: 1px #003399 solid;">
<form id='hotfileform' action='/hotfiles/submit' method='post' target='file_download'>
<input type=hidden name=authenticity_token value='<%=form_authenticity_token%>'></input>
<input type=hidden id=subfilename1 name=filename value=''></input>
<input type=hidden id=subfilehash1 name=filehash value=''></input>
<input type=hidden id=subfilesizelong name=filesizelong value=''></input>
<input type=hidden id=subfilesize1 name=filesize value=''></input>
<br/>
<table>
<tr><td align =center colspan=2><font size=+1><b>Submit it as a feartured file<b></font></td></tr>
<tr><td>File name</td><td><div id=subfilename></div></td></tr>
<tr><td>File size</td><td><div id=subfilesize></div></td></tr>
<tr><td>File description</td><td><input id=subfiledesc name=filedesc maxlength=250 size=50></input></td></tr>
<tr><td align=center colspan=2><input type=button onclick='submithotfile()' value="Submit"></input><span width=30>&nbsp;</div><input type=button onclick="javascript:closesubmit()" value="Cancel"></input></td>
</tr>
</table>
<br/>
</form>
</div>
<!--
<a href="javascript:showPop('myDiv', 400, 400);">Heres a simple popup example.</a>
-->
<iframe id="file_download"  name="file_download" width="0" height="0" scrolling="no" frameborder="0" src=""></iframe>
<script type='text/javascript' src='/javascripts/tooltips/wz_tooltip.js'></script>
<form id=chatform action="http://www.accessirc.net/pjirc/jchat.php?channel=%23antsp2p" method="POST" target=newzwind>
 <input type="hidden"  name="nick" value='<%= 'kerjo_'+((session[:user_nick].nil?) ?rand(99999).to_s : session[:user_nick])%>' />
</form>
<table width="100%" height="150" border="0" cellpadding="0" cellspacing="0" class="header">
  <tr> 
    <td height="150" background="/images/top_bg.jpg"> <div align="center"> 
        <table width="800" border="0" cellpadding="0" cellspacing="0" class="table2">
          <tr> 
            <td width="606"> <p class="p"><img src="/images/logo.jpg" width="571" height="114"></p></td>
            <td width="194" valign="top"> 
              <div align="right">
                <table border="0" cellpadding="0" cellspacing="4" class="importantTitle">
                  <tr><td width="35%">
	<table>
	<tr><td>
	<a href=/index>home</a></td></tr>
	<tr><td>
	<a href="#" onclick="javascript:document.getElementById('chatform').submit()">irc chat</a></td></tr>
	<tr><td>
	<a href=/friend>my network</a></td></tr>
	<tr><td>
	<a href=/index/logout>logout</a></td></tr>
	</table> 
                  </td>
<!--                    <a href="/index">home</a> | <a href="/friend">my network</a> | <a href="/index/logout">logout</a> -->
                  </tr>
                </table>
              </div></td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#F7FAFF"> 
      <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F7FAFF">
        <tr> 
          <td width="600" valign="top">
<table width="560" border="0" cellpadding="0" cellspacing="0" class="table2">
              <tr> 
                <td valign="bottom" class="importantTitle"><table width="531" border="0" align="left" cellpadding="0" cellspacing="0" class="ol">
                    <tr> 
                      <td ><img src="/images/banner1.jpg" width="100%"  /></td>
                    </tr>
                    <tr> 
                      <td><img src="/images/Table_TOP.gif" width="531" height="6"></td>
                    </tr>
                    <tr> 
                      <td height="5" bgcolor="#3E7DC4" class="importantTitle"><font color="white">&nbsp;&nbsp;Friend to friend anonymous p2p file sharing</FONT></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td valign="top"> 
                <TABLE width="530px" border="0" cellpadding="0" cellspacing="0" bgcolor="#D6F2FE" class="table2">
                    <TBODY>
 			<form id="mform" onsubmit='search();return false;' method='post'>
                           <tr>
                           <td colspan=2 height="35" class="importanttable">
                           <font>&nbsp; &nbsp; </font>Search p2p network for videos, mp3s, pictures etc:</td>
                           </tr>
                      <TR> 
                        <TD class="table2"><FONT >&nbsp; &nbsp; </FONT> 
                          <div id=searchstatus style="display:inline;" width="16px" height="16px" class='redb'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><INPUT id="q" name="q" class="INPUT" maxlength="2048" size=28 value="<%=params[:q]%>">
                          <a href="#" onclick='if(CanSearch)dosearch();return false;'><img src="/images/search.gif" width="86" height="23" border="0" align="absmiddle"></a></TD>
                        <TD height="32" class="table2">&nbsp;</TD>
                      </TR>
                      <TR> 
                        <TD height="33" class="table2">&nbsp; <INPUT type="CHECKBOX"  name="content" id="content" value="on" <%=params[:content]=="on"?"CHECKED":""%> >
                          content 
			<INPUT type="radio" id="c1" name="catelog" value="commit_string" <%=params[:catelog]!="commit_hash"?"CHECKED":""%>>by string
			<INPUT type="radio" name="catelog" value="commit_hash" id="c2" <%=params[:catelog]=="commit_hash"?"CHECKED":""%>>by hash&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><a href=http://127.0.0.1:54321/webgui/adddir onclick='return adddir();'>add shared directory</a></b>
                        </TD>
                        <TD class="table2">&nbsp;</TD>
                      </TR>
					  <TR valign="top"> 
                        <TD colspan="2"><img src="/images/Table_low.gif" width="531" height="6"></TD>
                      </TR>
                    </TBODY>
                  </TABLE>
                  </td>
              </tr>
			   <tr>
			  <td>&nbsp;</td>
			  </tr>
			  <tr> 
                <td valign="top"> <div align="left">
                    <TABLE width="530px" border="0" cellpadding="0" cellspacing="0" class="table2">
					  
			   <TR> 
                          <TD height="4" width="530px" colspan="3" bgcolor="#A3DBFE"></TD>
                        </TR>
           <script language=javascript>
           function changediv()
           {
           	obj1=document.getElementById('sres1');
           	obj2=document.getElementById('sres2');
           	obj3=document.getElementById('qres');
           	obj4=document.getElementById('dres');
           	if(obj3.style.display=='none')
           	{
           		obj3.style.display='block';
           		obj4.style.display='none';
           		obj1.innerHTML='SEARCH RESULTS';
           		obj2.innerHTML="<a href='search1' onclick='changediv();return false;'>DOWNLOAD QUEUE</a>";
           	}
           	else
           	{
           		obj4.style.display='block';
           		obj3.style.display='none';
           		obj1.innerHTML="<a href='seardch' onclick='changediv();return false;'>SEARCH RESULTS</a>";
           		obj2.innerHTML='DOWNLOAD QUEUE';
           	}
           }
           </script>
                        <TR> 
                          <TD class="importantTitle" width="390px" valign="bottom" bgcolor="#D7F0FF"><div id=sres1>SEARCH RESULTS</div></TD>
                          <TD class="importantTitle" valign="bottom" bgcolor="#D7F0FF"><div id=sres2><a href='seardch' onclick='changediv();return false;'>DOWNLOAD QUEUE</a></div></TD>
                          <TD width='1px'>&nbsp;</td>
                        </TR>
                        <TR>
                        <td colspan=2>
                <div id="qres" style='width:529px;display:block'></div>
                <div id="dres" style='width:529px;display:none'></div>
                        </td> <td width='1px' height='40px'>&nbsp;</td>
                        </TR>
                    </TABLE>
                  </div>
                </td>
              </tr>
              <tr> 
                <td valign="top"> 
                <TABLE width="530px" border="0" cellpadding="0" cellspacing="0" bgcolor="#D6F2FE" class="table2">
                    <TBODY>
						<TR style='width:530px;'><td class="title"  bgcolor="#A3DBFE" style='width:530px;'><font><img src="/images/Bit.gif" align="absmiddle" height="15" width="14">&nbsp; </font>Tips: </td></tr>
						<TR style='width:530px;'>
                      		<TD  bgcolor="#A3DBFE">
                      		<ul>
                          <li><div style="display:inline;" width="16px" height="16px" class='redb'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>please wait - downloading java p2p client-can't search, can't add shared directory;
						  </li><li><div style="display:inline;" width="16px" height="16px" class='yellowb'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>please wait - connecting to p2p network- can't search, but can add shared directory;
						  </li><li><div style="display:inline;" width="16px" height="16px" class='greenb'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>connected - now you can search for files, can add shared directory.
						  </li><li> To share files with friends, click "<b><a href=http://127.0.0.1:54321/webgui/adddir onclick='return adddir();'>add shared directory</a></b>" when the light is not red.
                          </li><li> To share files with more friends, pls click "<b><a href=/friend/>my network</a></b>" to join more networks and to find and add more new friends sharing interests.
                          </li><li> The downloaded files are stored in "Program Files/Mozilla Firefox/Kerjordano/downloads/"(for firefox,on windows platform).
						  </li></ul>
						  </td></tr>
					</TBODY>
				</TABLE>
				</td>
			</tr>
            </table>
          </td>
          <td width="200" valign="top" class="ol"> 
	<script type="text/javascript">
	<!--
	ad_id = new Array();
	var iInt = 2;
	ad_id[0] = "pub-1769494803367803";
	ad_id[1] = '<%=h session[:googleadid].to_s.gsub(/\'/,"\\\\'")%>';
	if(ad_id[1].length==0)ad_id[1]=ad_id[0];
	google_ad_client = ad_id[Math.floor(iInt * Math.random())];
	/* 160x600, created 14/03/08 */
	google_ad_slot = "8990189854";
	google_ad_width = 200;
	google_ad_height = 600;
	//-->
	</script>
	<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script>
          </td>
        </tr>
      </table>
      <div align="center"></div></td>
  </tr>
</table>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="copyright">
  <tr> 
    <td height="112" valign="middle">
<div align="center">
        <table width="800" height="59" border="0" cellpadding="0" cellspacing="0" class="table2">
          <tr> 
            <td><div align="center">Powered by <a href="http://code.google.com/p/kerjodando/source"><img src="/images/poweredKerjo.jpg" width="143" height="62" border="0" align="middle"></a>&nbsp; 
                <a href="http://www.rubyonrails.org/"><img src="/images/poweredrails.gif" width="57" height="62" border="0" align="middle"></a>&nbsp; 
                <a href="http://java.sun.com/javase/downloads/index.jsp"><img src="/images/poweredjava.jpg" width="143" height="62" border="0" align="middle"></a>&nbsp; 
                <a href="https://www.thawte.com/ssl-digital-certificates/code-signing/index.html?click=main-nav-products-codesigning"><img src="/images/poweredthawte_trust.jpg" width="206" height="62" border="0" align="middle"></a></div></td>
          </tr>
          <tr> 
            <td><div align="center">This website is owned, developed and published 
                by Digiworld Ltd, London, UK (07914 245 451 SMS only). Contact 
                ezzy at Digiworldltd.com. Please respect copyright and only share 
                creative commons or non-copyright files. </div></td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
if (typeof(_gat)!='undefined')
{
	var pageTracker = _gat._getTracker("UA-1242141-2");
	pageTracker._initData();
	pageTracker._trackPageview();
}
</script>
</body>
</html>